<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
	</head>

	<body erke-hide>
	</body>
	<script>
	 /* @param {string[]} words
 * @return {number}
 */
var uniqueMorseRepresentations = function(words) {
    var aAronDie=[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."];
    var res=[];
    for(var i=0;i<words.length;i++){
    	var str="";
    	for(var j=0;j<words[i].length;j++){
    		str+=aAronDie[words[i][j].toLowerCase().charCodeAt()-97];
    	};
    	if(!aAron(res,str)){
    		res.push(str);
    	};
    };
    console.log(res);
    return res.length;
};
function aAron(arr,str){
	for(var i in arr){
		if(arr[i]==str){
			return true;
		};
	};
	return false;
};
res = new uniqueMorseRepresentations(["gin", "zen", "gig", "msg"]);
	</script>

</html>